<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title>exp4-2</title>
		<style>
			
		</style>
	</head>
	<body>
		<?php
		$str1 = 'The Quick Brown Fox';
		$str2 = strtolower($str1);
		$str3 = str_replace('brown','red',$str2);
		echo '<p>', $str1, '</p>';
		echo '<p>', $str3, '</p>';
		// 有参函数
		function encrypt($str2){
			$zValue = ord("z");
			$aValue = ord("a");
			for($i = 0; $i < strlen($str2); $i++){
				$value = ord($str2[$i]);
				if($value > $zValue || $value < $aValue){
					continue;
				}
				$value = $value + 5;
				if($value > $zValue){
					$value -= 26;
				}
				$str2[$i] = chr($value);
			}
			echo $str2;
		}
		echo "循环移位加密后：";
		encrypt($str2);
		?>  
	</body>
</html>
